package com.quad.innovators.salesease.converter;


import com.quad.innovators.salesease.model.entity.SysMenu;
import com.quad.innovators.salesease.model.form.SysMenuForm;
import com.quad.innovators.salesease.model.vo.SysMenuVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;


@Mapper(componentModel = "spring")
public interface SysMenuConverter {
    SysMenuVO toVo(SysMenu entity);

    @Mappings({
            @Mapping(target = "params", ignore = true)
    })
    SysMenuForm toForm(SysMenu entity);

    @Mappings({
            @Mapping(target = "params", ignore = true),
            @Mapping(target = "parentId", ignore = true)
    })
    SysMenu toEntity(SysMenuForm menuForm);
}
